package com.ccq.service;

import com.alibaba.fastjson.JSON;
import com.ccq.mapper.RecordMapper;
import com.ccq.mapper.RentingMapper;
import com.ccq.mapper.SecondMapper;
import com.ccq.model.Record;
import com.ccq.model.Renting;
import com.ccq.model.Second;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AboutService {
    @Autowired
    SecondMapper secondMapper;

    @Autowired
    RecordMapper recordMapper;

    @Autowired
    RentingMapper rentingMapper;

    public Second basicdata(int id){
        Second ls=secondMapper.selectByPrimaryKey(id);
        String aListJson = JSON.toJSONString(ls);
        System.out.println(aListJson);
        return ls;
    }

    public Renting basicdata1(int id){
        Renting ls=rentingMapper.selectByPrimaryKey(id);
        String aListJson = JSON.toJSONString(ls);
        System.out.println(aListJson);
        return ls;
    }

    public String record(int id){
        List<Record> ls=recordMapper.selectAllData(id);
        String aListJson = JSON.toJSONString(ls);
        System.out.println(aListJson);
        return aListJson;
    }
}
